#include "widgets/hframe1.h"

#include <QPainter>
#include <QRect>

HFrame1::HFrame1(QWidget *parent) :
    QFrame(parent),
    mBackgroundType(Normal)
{

}

void HFrame1::paintEvent(QPaintEvent *event)
{
    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing, true);
    painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
    QPainterPath path;
    path.addRoundedRect(rect(), 10, 10);
    painter.fillPath(path, QColor(240, 240, 240));
    QFrame::paintEvent(event);
}

HFrame1::BackgroundType HFrame1::backgroundType() const
{
    return mBackgroundType;
}

void HFrame1::setBackgroundType(const BackgroundType &backgroundType)
{
    mBackgroundType = backgroundType;
}
